#ifndef RISING_STAR_WEB_SOCKET_SERVER_H
#define RISING_STAR_WEB_SOCKET_SERVER_H

#include "Config.h"
#include "Services.h"

//#define ASIO_STANDALONE

#include <websocketpp/config/asio_no_tls.hpp>
#include <websocketpp/server.hpp>

#include <functional>

typedef websocketpp::server<websocketpp::config::asio> WebSocketServer;
using namespace boost::asio;
using namespace boost;



namespace RisingStar
{
	class CWebSocketServer:public boost::noncopyable
	{


private:
    

	
	public:
		explicit CWebSocketServer(WORD port);
		~CWebSocketServer();
		
		void Run();
		void EchoHandler(websocketpp::connection_hdl hdl, WebSocketServer::message_ptr msg);
		
	protected:
		
		//asio::io_service mService;
		//IOServicePtr mServicePtr;
		bool CreateNewSession();
		
		//服务处理
		void ServicesProcess();
		
		
		WebSocketServer mEndpoint;
	};
	
	
}

#endif
